<?php
/**
 * 	Bushido
 *
 * @category   Bushido
 * @package    Bushido
 * @copyright  Copyright (c) 2008-2009 Nathan Keyes
 * @author Nathan Keyes
 * @version    $Id: FieldType.php 7 2009-11-14 22:42:08Z nkeyes $
 */

class Bushido_DbTable_FieldType extends Bushido_Db_Table_Abstract
{
	protected $_name = 'field_type';
	
	protected $_sequence = true;
	
	
	protected $_referenceMap = array
	(
	);
	
	protected $_childMap = array
	(
		'ClassFieldTypes' => array
		(
			'refTableClass' => 'Bushido_DbTable_ClassFieldType',
			'cardinality' => Bushido_Db_Table_Abstract::ZERO_OR_MANY
		),
	);
	
	
	/**
	 * (non-PHPdoc)
	 * @see library/Bushido/Db/Table/Bushido_Db_Table_Abstract#_setFieldDetails()
	 */
	protected function _setFieldDetails()
	{
		//name
		$this->_metadata['name']['fieldDetails'] = array
		(
			'options' => array
			(
				'label' => 'Name:',
				'required' => true,
				'invalidMessage' => 'Please enter a Name.'
			) 
		);
		
		//field_table
		$this->_metadata['field_table']['fieldDetails'] = array
		(
			'options' => array
			(
				'label' => 'Table:',
				'required' => true,
				'invalidMessage' => 'Please enter a Table name.'
			) 
		);
	}
	
	/**
	 * (non-PHPdoc)
	 * @see library/Bushido/Db/Table/Bushido_Db_Table_Abstract#getDisplayValue()
	 */
	public static function getDisplayValue(Zend_Db_Table_Row_Abstract $row, $context = null)
	{
		return $row->name;
	}
}